#include "Action.h"

// Constructors
Action::Action()
{

	this->name = "";
	this->amount = 0;

}

Action::Action( std::string name, std::string user )
{

	this->name = name;
	this->user = user;
	this->amount = 1;

}

Action::Action( std::string name, std::string user, int amount )
{

	this->name = name;
	this->user = user;
	this->amount = amount;

}

// Getters
std::string Action::getName() const
{

	return this->name;

}

int Action::getAmount() const
{

	return this->amount;

}

// Setters
void Action::setName( std::string name )
{

	this->name = name;

}

void Action::setUser( std::string user )
{

	this->user = user;

}

void Action::setAmount( int amount )
{

	this->amount = amount;

}

// Operator overloading
std::ostream & operator<<( std::ostream & os, const Action & action )
{

	os << action.user << " " << action.name;
	if( action.amount > 1 )
		os << action.amount;
	return os;

}
